﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="/Scripts/szjt-allScripts.js" type="text/javascript"></script>
</head>
<body>
    <div id="searchCondition" formType="query">
        <table id="Student" class="szjt-edittable" width="100%">
            <tr>
                <td required="true">学员姓名</td>
                <td><input id="Student_StudentName" type="text" class="easyui-validatebox" /></td>
                <td>学员性别</td>
                <td><select id="Student_StudentSex" type="text" class="szjt-codecombo" required="true" category="性别" /></td>
            </tr>
            <tr>
                <td>学员学号</td>
                <td><input id="Student_StudentID" type="text" class="easyui-validatebox" /></td>
                <td>使用人员</td>
                <td><input id="Student_StudentMobile" type="text" class="easyui-validatebox" /></td>
            </tr>
        </table>
        <input id="Student_PageIndex" type="hidden" class="easyui-validatebox" value="0" />
        <input id="Student_PageSize" type="hidden" class="easyui-validatebox" value="10" />
    </div>
    <table id="studentList"></table>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#searchCondition").formpanel({
                formType: "query",
                formTemplate: PrjConstant.Business.Student.StudentQuery.Template,
                taskGuid: PrjConstant.SysInfo.TaskGuid,
                onExecuteComplete: function (queryResult) {
                    $("#studentList").detailgrid("loadXmlString", { xml: queryResult, totalNode: "RecordCount", dataNode: "StudentInfo" });
                    //$("#AssetList").triggerHandler("_buttonstatus");
                }
                //            onCollapse: function () {
                //                $("#AssetList").datagrid("getPanel").parent().triggerHandler("_resize");
                //            },
                //            onExpand: function () {
                //                $("#AssetList").datagrid("getPanel").parent().triggerHandler("_resize");
                //            }
            });

            $("#studentList").detailgrid({
                bizName: '学员信息',
                guidColumn: 'StudentGuid',
                nameColumn: 'StudentName',
                fit: true,
                pageSize: $("#Student_PageSize").val(),
                columns: [[
                    { field: 'StudentGuid', title: 'GUID', hidden: true },
                    { field: 'StudentName', title: '学员姓名', width: 100 },
                    { field: 'StudentSex', title: '性别', width: 30 },
                    { field: 'StudentAge', title: '年龄', width: 30 },
                    { field: 'StudentID', title: '学员学号', width: 100 },
                    { field: 'StudentIdType', title: '证件类别', width: 100 },
                    { field: 'StudentIdCode', title: '证件号', width: 100 },
                    { field: 'StudentMobile', title: '学员手机', width: 100 },
                    { field: 'StudentStatus', title: '学员状态', width: 100 }
                ]],
                onAction: function (actionCode, actionName, bizName, selectedList) {
                    if (actionCode == "delete") {
                        var result = dataService.delDataList(PrjConstant.SysInfo.TaskGuid, selectedList, PrjConstant.Business.Student.StudentInfo.DataType);
                        utility.message.promptOperationResult(actionName, bizName, (result == 0));
                    }
                    else {
                        //alert("1q2:" + actionName + bizName + ":" + selectedList);
                        utility.page.popupDialog({ editParameter: { actionCode: actionCode, selectedList: selectedList },
                            title: actionName + bizName, width: 600, height: 310,
                            parentTitle: utility.page.getCurrentTabTitle(),
                            href: '/Pages/Business/Student/StudentInfo.htm'
                        });
                    }
                },
                onSelectPage: function (pageNumber, pageSize) {
                    $("#Student_PageIndex").val(pageNumber - 1);
                    RefreshData();
                }
            });
        });

        function RefreshData() {
            $("#searchCondition").triggerHandler("_execute");

        }
    </script>
</body>
</html>
